package com.designpattern.observer;

/**
 * @author liyanhao
 * @Date 2023-02-17 10:17
 * 天气预报公司自己的布告板
 */
public class CurrentConditionsDisplay implements Observer {

    //温度
    private float temperature;
    //湿度
    private float humidity;
    //压力
    private float pressure;

    @Override
    public void update(float temp, float humidity, float pressure) {
        this.temperature = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        display();
    }

    @Override
    public void display() {
        System.out.println("当前温度:" + this.temperature + "当前湿度:" + this.humidity
                + "当前压力:" + pressure);
    }

}
